import static java.lang.Thread.sleep;

public class ThradDemo4 {
    public static void main(String[] args) {
        Thread t=new Thread(()->{
            int num=0;
            while (true){
                num++;
                System.out.println(num);
                try {
                    sleep(30);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
